<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="<?php echo X_UA_COMPATIBLE; ?>" />
<meta name="keywords" content="<?php echo $this->_meta_keywords; ?>" />
<meta name="description" content="<?php echo $this->_meta_description; ?>"  />
<link rel="shortcut icon" href="<?php echo G_STATIC_URL; ?>/css/default/img/favicon.png?v=<?php echo G_VERSION_BUILD; ?>" type="image/x-icon"/>
<?php if (defined('G_INDEX_SCRIPT') AND !strstr(G_INDEX_SCRIPT, '?')) { ?>
<base href="<?php echo get_setting('base_url');?>/<?php echo G_INDEX_SCRIPT; ?>" />
<?php } ?>
<?php if (is_array($this->_import_css_files)) { ?>
<?php foreach ($this->_import_css_files AS $import_css) { ?>
<link href="<?php echo G_STATIC_URL; ?>/<?php echo $import_css; ?>?v=<?php echo G_VERSION_BUILD; ?>" rel="stylesheet" type="text/css" />
<?php } ?>
<?php } ?>
<?php if (is_array($this->_import_js_files)) { ?>
<?php foreach ($this->_import_js_files AS $import_js) { ?>
<script src="<?php echo G_STATIC_URL; ?>/<?php echo $import_js; ?>?v=<?php echo G_VERSION_BUILD; ?>" type="text/javascript"></script>
<?php } ?>
<?php } ?>

<?php $post_hash_var_name = strtoupper(md5(time() . $this->userinfo['salt'])); ?>
<script type="text/javascript">
	var _<?php echo $post_hash_var_name; ?>='<?php echo new_post_hash(); ?>';
	var G_POST_HASH=_<?php echo $post_hash_var_name; ?>;
	var G_INDEX_SCRIPT = '<?php echo G_INDEX_SCRIPT; ?>';
	var G_SITE_NAME = '<?php echo get_setting('site_name'); ?>';
	var G_BASE_URL = '<?php echo get_setting('base_url'); ?><?php if (G_INDEX_SCRIPT) { ?>/<?php echo rtrim(G_INDEX_SCRIPT, '/'); ?><?php } ?>';
	var G_STATIC_URL = '<?php echo G_STATIC_URL; ?>';
	var G_UPLOAD_URL = '<?php echo get_setting('upload_url'); ?>';
	var G_USER_ID = <?php echo $this->user_id; ?>;
	var G_USER_NAME = '<?php echo $this->user_info['user_name']; ?>';
	var G_UPLOAD_ENABLE = '<?php echo get_setting('upload_enable'); ?>';
	
	var G_QUICK_PUBLISH_HUMAN_VALID = '<?php if (human_valid('question_valid_hour')) { ?>1<?php } ?>';
		
	var elementClickEvent = new strClick_show();	// for global declare fun	
</script>
<title><?php echo $this->page_title; ?></title>
</head>

<body>
<!--[if IE 6]>
<style type="text/css">.isIE6{ background:#feb300; border-bottom:1px solid #dfdfdf; height:40px; line-height:40px; font-size:18px; font-weight:bold; color:#000; font-family:"微软雅黑"; padding:0 20px; text-align:center;width:100%;white-space:nowrap;}.isIE6 a{ color:blue;}.isIE6 a:hover{color:blue; text-decoration:underline;}</style>
<div class="isIE6">你目前使用的浏览器版本过低，将不能使用本站部分功能。请安装 <a href="http://www.google.cn/chrome/eula.html?hl=zh-CN&platform=win">Google 浏览器</a>获取最佳的浏览效果。</div>
<![endif]-->
<div id="Wrapper">
<!--header_s-->
<div class="header">
  <div class="default_width">
  <?php if (!$this->user_id) { ?> 
    <p class="default_login_v2"><a href="account/login/">登录</a><?php if (get_setting('invite_reg_only') == 'N') { ?> | <a href="account/register/">注册</a><?php } ?></p>
  <?php } ?>
    <h1 class="logo"><a href="<?php echo get_setting('base_url'); ?><?php if (G_INDEX_SCRIPT) { ?>/<?php echo rtrim(G_INDEX_SCRIPT, '/'); ?><?php } ?>" hidefocus="true" title="<?php echo get_setting('site_name'); ?>">&nbsp;</a></h1>
    <?php if ($this->user_id) { ?>
    <div class="search">
      <ul class="searchLis">
        <li class="i_li fl">
          <input type="button" id="gl_search" class="i_btn fr" value=""/>
          <input name="q" id="global_search" placeholder="搜索话题、问题或人…" title="搜索话题、问题或人…" type="text" id="s_txt" class="i_txt" />
		  <div class="default_search hide" id="default_search"></div>
        </li>
        <li class="userName_li fr">
          <div class="userElementInfo elementsChanges" >
            <p class="userTop" onclick="window.location = G_BASE_URL + '<?php if (!$this->user_info['user_name']) { ?>account/?c=setting&act=user<?php } else { ?>/people/<?php } ?>'"><img src="<?php if ($this->user_info['uid']) { echo get_avatar_url($this->user_info['uid'], 'mid', $this->user_info['avatar_file']); } else { echo G_STATIC_URL . '/common/avatar-min-img.jpg'; } ?>" class="ig"/>
			<span class="default_s<?php if ($this->user_info['notice_unread'] < 1) { ?> hide<?php }?>" id="header_inbox_unread"><a href="inbox/"><?php echo $this->user_info['notice_unread'];?></a></span></p>
            <p class="userLister">
				<a href="people/" class="r0" title="个人主页">个人主页</a>
				<a href="inbox/" class="r1" title="私信">私信<span style="display:none;" id="inbox_num" class="default_s"><?php echo $this->inbox_unread;?></span></a>
				<a href="account/setting/profile/" class="r2" title="设置">设置</a>
				<?php if($this->user_info['permission']['is_administortar'] ){ ?><a href="admin/" class="r2" title="管理中心" target=_blank>管理中心</a><?php } ?>
				<a href="account/logout/" class="r3" title="退出">退出</a>
			</p>
          </div>
        </li>
        <li class="default_seach"> <a title="发起" href="publish/category_id-<?php echo $_GET['category']; ?>" class="flx"<?php if(get_setting('quick_publish') == 'Y') { ?> onclick="elementClickEvent.letter.moudleTips_start({'category':'<?php echo $_GET['category']; ?>'}); return false;"<?php } ?>>发起</a> <a title="首页" href="<?php echo get_setting('base_url'); ?><?php if (G_INDEX_SCRIPT) { ?>/<?php echo rtrim(G_INDEX_SCRIPT, '/'); ?><?php } ?>">首页</a><a href="home/explore/" title="发现">发现</a><a title="通知" href="notifications/">通知<span class="<?php if ($this->user_info['notification_unread'] == 0) { ?>hide <?php } ?>default_s" id="notifications_num"><?php echo $this->user_info['notification_unread']; ?></span></a></li>
      </ul>
    </div>
    <?php } ?>
  </div>
</div>
<!--header_e-->